-- GENERATED SPELL FOR [Malgen Longspear] --


function spell0_16052(pUnit, Event) --@Aimed Shot,n/a--
pUnit:FullCastSpellOnTarget(27632,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16052', 3000, 1)
end

function spell1_16052(pUnit, Event) --@Concussive Shot,n/a--
pUnit:FullCastSpellOnTarget(27634,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16052', 3283, 1)
end

function spell2_16052(pUnit, Event) --@Drink Healing Potion,Self--
pUnit:FullCastSpellOnTarget(15503,pUnit)
pUnit:RegisterEvent('Sorts_16052', 617, 1)
end

function spell3_16052(pUnit, Event) --@Freezing Trap,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(27753,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_16052', 1, 1)
end

function spell4_16052(pUnit, Event) --@Multi-Shot,n/a--
pUnit:FullCastSpellOnTarget(18651,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16052', 581, 1)
end

function spell5_16052(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(16100,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16052', 605, 1)
end

function spell6_16052(pUnit, Event) --@Wing Clip,n/a--
pUnit:FullCastSpellOnTarget(27633,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16052', 10272, 1)
end

function Sorts_16052(pUnit, Event)
local choix_sorts_16052 = math.random(0, 6)
if choix_sorts_16052 == 0 then
pUnit:RegisterEvent('spell0_16052', 1, 1)
end
if choix_sorts_16052 == 1 then
pUnit:RegisterEvent('spell1_16052', 1, 1)
end
if choix_sorts_16052 == 2 then
pUnit:RegisterEvent('spell2_16052', 1, 1)
end
if choix_sorts_16052 == 3 then
pUnit:RegisterEvent('spell3_16052', 1, 1)
end
if choix_sorts_16052 == 4 then
pUnit:RegisterEvent('spell4_16052', 1, 1)
end
if choix_sorts_16052 == 5 then
pUnit:RegisterEvent('spell5_16052', 1, 1)
end
if choix_sorts_16052 == 6 then
pUnit:RegisterEvent('spell6_16052', 1, 1)
end
end

function mob16052_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16052', math.random(1500, 3000), 1)
end

function mob16052_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16052_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16052_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16052, 1, 'mob16052_Action')
RegisterUnitEvent(16052, 2, 'mob16052_Leave')
RegisterUnitEvent(16052, 3, 'mob16052_Kill')
RegisterUnitEvent(16052, 4, 'mob16052_Die')
